package kr.co.doriclassic.pro06_05;

import java.util.Scanner;

public class Ex05 {
	public static void main(String[] args) {
		int num;
		Scanner sc = new Scanner(System.in);
		
		System.out.print("정수를 입력하시오:");
			num=sc.nextInt();
			
			fx(num);
	}

	private static void fx(int num) {
		int result;
		if(num<=0){
			result=(num*num*num)-(9*num) + 2;
		}
		else{
			result=(7*num)+2;
		}
		System.out.printf("계산된 값은 : %d",result);
	}
}	